﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace HigLabo.Net.Twitter
{
    /// <summary>
    /// 
    /// </summary>
    public partial class TwitterClient
    {
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public ListCollection GetAllLists()
        {
            return this.GetAllLists(null as GetAllListsCommand);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public ListCollection GetAllLists(GetAllListsCommand command)
        {
            String jsonText = this.GetResultText(TwitterApiUrl.Version1_1.Lists.GetAllListsUrl, command);
            return new ListCollection(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public StatusCollection GetListsStatuses(GetListsStatusesCommand command)
        {
            String jsonText = this.GetResultText(TwitterApiUrl.Version1_1.Lists.GetListsStatusesUrl, command);
            return new StatusCollection(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public User DestroyListMembers(DestroyListsMembersCommand command)
        {
            String jsonText = this.GetResultText(HttpMethodName.Post, TwitterApiUrl.Version1_1.Lists.DestroyListsMembersUrl, command);
            return new User(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public Memberships GetListsMemberships(GetListsMembershipsCommand command)
        {
            String jsonText = this.GetResultText(TwitterApiUrl.Version1_1.Lists.GetListsMembershipsUrl, command);
            return new Memberships(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public FriendsUser GetListsSubscribers()
        {
            return this.GetListsSubscribers(null as GetListsSubscribersCommand);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public FriendsUser GetListsSubscribers(GetListsSubscribersCommand command)
        {
            String jsonText = this.GetResultText(TwitterApiUrl.Version1_1.Lists.GetListsSubscribersUrl, command);
            return new FriendsUser(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public List CreateListsSubscribers(CreateListsSubscribersCommand command)
        {
            String jsonText = this.GetResultText(HttpMethodName.Post, TwitterApiUrl.Version1_1.Lists.CreateListsSubscribersUrl, command);
            return new List(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public User ShowListsSubscribers(ShowListsSubscribers command)
        {
            String jsonText = this.GetResultText(TwitterApiUrl.Version1_1.Lists.ShowListsSubscribersUrl, command);
            return new User(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public User DestroyListsSubscribers(DestroyListsSubscribersCommand command)
        {
            String jsonText = this.GetResultText(HttpMethodName.Post, TwitterApiUrl.Version1_1.Lists.DestroyListsSubscribersUrl, command);
            return new User(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="values"></param>
        /// <returns></returns>
        public FriendshipCollection CreateAllListsMembers(params Int64[] values)
        {
            StringBuilder sb = new StringBuilder(256);
            for (int i = 0; i < values.Length; i++)
            {
                sb.Append(values[i]);
                if (i < values.Length - 1)
                {
                    sb.Append(",");
                }
            }
            var cm = new CreateAllListsMembersCommand();
            cm.UserID = sb.ToString();
            return this.CreateAllListsMembers(cm);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="values"></param>
        /// <returns></returns>
        public FriendshipCollection CreateAllListsMembers(params String[] values)
        {
            StringBuilder sb = new StringBuilder(256);
            for (int i = 0; i < values.Length; i++)
            {
                sb.Append(values[i]);
                if (i < values.Length - 1)
                {
                    sb.Append(",");
                }
            }
            var cm = new CreateAllListsMembersCommand();
            cm.ScreenName = sb.ToString();
            return this.CreateAllListsMembers(cm);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public FriendshipCollection CreateAllListsMembers(CreateAllListsMembersCommand command)
        {
            String jsonText = this.GetResultText(HttpMethodName.Post, TwitterApiUrl.Version1_1.Lists.CreateAllListsMembersUrl, command);
            return new FriendshipCollection(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public User ShowListsMembers(ShowListsMembersCommand command)
        {
            String jsonText = this.GetResultText(TwitterApiUrl.Version1_1.Lists.ShowListsMembersUrl, command);
            return new User(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public FriendsUser GetListsMembers(GetListsMembersCommand command)
        {
            String jsonText = this.GetResultText(TwitterApiUrl.Version1_1.Lists.GetListsMembersUrl, command);
            return new FriendsUser(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public User CreateListsMembers(CreateListsMembersCommand command)
        {
            String jsonText = this.GetResultText(HttpMethodName.Post, TwitterApiUrl.Version1_1.Lists.CreateListsMembersUrl, command);
            return new User(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public List DestroyLists(DestroyListsCommnad command)
        {
            String jsonText = this.GetResultText(HttpMethodName.Post, TwitterApiUrl.Version1_1.Lists.DestroyListsUrl, command);
            return new List(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public List UpdateLists(UpdateListsCommand command)
        {
            String jsonText = this.GetResultText(HttpMethodName.Post, TwitterApiUrl.Version1_1.Lists.UdateListsUrl, command);
            return new List(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public List CreateLists(CreateListsCommnad command)
        {
            String jsonText = this.GetResultText(HttpMethodName.Post, TwitterApiUrl.Version1_1.Lists.CreateListsUrl, command);
            return new List(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public Memberships GetLists(GetListsCommand command)
        {
            String jsonText = this.GetResultText(TwitterApiUrl.Version1_1.Lists.GetListsUrl, command);
            return new Memberships(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public List ShowLists(ShowListsCommnad command)
        {
            String jsonText = this.GetResultText(TwitterApiUrl.Version1_1.Lists.ShowListsUrl, command);
            return new List(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public Memberships GetListsSubscriptions(GetListsSubscriptionsCommand command)
        {
            String jsonText = this.GetResultText(TwitterApiUrl.Version1_1.Lists.GetListsSubscriptionsUrl, command);
            return new Memberships(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="values"></param>
        /// <returns></returns>
        public FriendshipCollection DestroyAllListsMembers(params Int64[] values)
        {
            StringBuilder sb = new StringBuilder(256);
            for (int i = 0; i < values.Length; i++)
            {
                sb.Append(values[i]);
                if (i < values.Length - 1)
                {
                    sb.Append(",");
                }
            }
            var cm = new DestroyAllListsMembersCommand();
            cm.UserID = sb.ToString();
            return this.DestroyAllListsMembers(cm);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="values"></param>
        /// <returns></returns>
        public FriendshipCollection DestroyAllListsMembers(params String[] values)
        {
            StringBuilder sb = new StringBuilder(256);
            for (int i = 0; i < values.Length; i++)
            {
                sb.Append(values[i]);
                if (i < values.Length - 1)
                {
                    sb.Append(",");
                }
            }
            var cm = new DestroyAllListsMembersCommand();
            cm.ScreenName = sb.ToString();
            return this.DestroyAllListsMembers(cm);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public FriendshipCollection DestroyAllListsMembers(DestroyAllListsMembersCommand command)
        {
            String jsonText = this.GetResultText(HttpMethodName.Post, TwitterApiUrl.Version1_1.Lists.DestroyAllListsMembersUrl, command);
            return new FriendshipCollection(jsonText);
        }
    }
}
